Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce lock contention when disabling compactions #8567

Merged
merged 1 commit into from
Jul 6, 2017
Merged

Conversation

jwilder
Copy link
Contributor

@jwilder jwilder commented Jul 5, 2017

The monitor goroutine calls enable compactions every 10s to spin down
(or start up) goroutines for cold shards. This frequent Lock may be
causing lock contention for writes and queries which get blocked trying
to acquire an RLock.

The go RWMutex says that new RLock calls will block if there is a
pending Lock call that is blocked. Switching the common path to use
an RLock should avoid the Lock and reduce lock contention for writes
and queries.

Required for all non-trivial PRs
  • Rebased/mergable
  • Tests pass
  • CHANGELOG.md updated
  • Sign CLA (if not already signed)

The monitor goroutine calls enable compactions every 10s to spin down
(or start up) goroutines for cold shards.  This frequent Lock may be
causing lock contention for writes and queries which get blocked trying
to acquire an RLock.

The go RWMutex says that new RLock calls will block if there is a
pending Lock call that is blocked.  Switching the common path to use
an RLock should avoid the Lock and reduce lock contention for writes
and queries.
@jwilder jwilder requested a review from e-dard July 5, 2017 21:46
@jwilder jwilder added the review label Jul 5, 2017
Copy link
Contributor

@e-dard e-dard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@jwilder jwilder merged commit 16af32b into master Jul 6, 2017
@jwilder jwilder removed the review label Jul 6, 2017
@jwilder jwilder deleted the jw-monitor-lock branch July 6, 2017 23:02
@jwilder jwilder restored the jw-monitor-lock branch July 6, 2017 23:02
@jwilder jwilder mentioned this pull request Jul 7, 2017
4 tasks
@mark-rushakoff mark-rushakoff deleted the jw-monitor-lock branch April 20, 2018 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants